#ifndef SCATTERPLOTVIEW_H
#define SCATTERPLOTVIEW_H

#include <QDockWidget>
#include <functionalnetwork.h>
#include <views/abstractView.h>
#include <qwt_plot.h>
#include <qwt_plot_curve.h>
#include <qwt_plot_picker.h>
#include <qwt_plot_zoomer.h>
#include <qwt_symbol.h>
#include <QButtonGroup>
#include <qwt_legend.h>
#include <qwt_text.h> 

namespace Ui {
    class ScatterPlotView;
}

class ScatterPlotView : public AbstractView {
    Q_OBJECT

enum SelectionMode
{
    SelectRegions,
    SelectLinks
};

public slots:
    void plotPointsSelected(const QwtDoubleRect&);

public:
    ScatterPlotView(QWidget *parent = 0);
    ~ScatterPlotView();

    virtual void setNetwork(FunctionalNetwork *netwo);
    void updateView();

private:
	void createExpectedCurve();

protected:
    void changeEvent(QEvent *e);
    virtual void updateSelection();

    Ui::ScatterPlotView *ui;

	QwtPlotCurve *curveNoSel;
    QwtPlotCurve *curveSel;

	QwtPlotCurve *expectedCurve;
    QwtPlotZoomer *zoomer;

	bool isZooming;
    QwtPlotPicker *picker;
    QButtonGroup bGroup;
    SelectionMode mode;
	bool compensateSymm;

private slots:
    void on_zoomOutButton_clicked();
    void on_zoomInButton_toggled(bool checked);
    void on_selectButton_toggled(bool checked);
	void on_toggleSymmetryButton_toggled(bool checked);

protected slots:
	virtual void on_matrixChanged();
};

#endif // SCATTERPLOTDOCKWIDGET_H
